package com.xpec.cipher.tals.record;

import org.jboss.netty.buffer.ChannelBuffer;

import com.xpec.cipher.tals.TalsConstance;

public class AppDataRecord extends TalsRecord {
	private ChannelBuffer encrypted = null;

	public AppDataRecord(ChannelBuffer _buffer) {
		this.encrypted = _buffer;
	}
	
	@Override
	protected int getContentLength() {
		return encrypted.readableBytes();
	}

	@Override
	protected byte getContentType() {
		return TalsConstance.CONTENT_TYPE_APP_DATA;
	}

	@Override
	protected ChannelBuffer resolveSubStruct() {
		return encrypted;
	}
}
